package scau.jump.securitytrace.listener;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import org.apache.log4j.Logger;

import scau.jump.securitytrace.cache.ProductCache;
import scau.jump.securitytrace.ui.MainFrame;
import scau.jump.securitytrace.ui.MainFrameFactory;
import scau.jump.securitytrace.util.StringUtil;

public class ProductComboBoxActionListener implements ActionListener{
	
	private static final Logger logger = Logger.getLogger(MainFrameStartButtonListener.class);
	
	MainFrame mainFrame = MainFrameFactory.getMainFrame();
	
	@Override
	public void actionPerformed(ActionEvent e) {
		logger.debug("下拉列表 改变内容");
		String selectedItem = mainFrame.getSelectProductComboBox().getSelectedItem().toString();
		String productOtherInfo = ProductCache.productOtherInfoMap.get(selectedItem);
		mainFrame.getProductOtherInfoTextArea().setText(StringUtil.splitAndNewline(productOtherInfo));
	}

}
